package com.neuedu.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neuedu.dao.GoodsDao;
import com.neuedu.model.Goods;
import com.neuedu.service.GoodsService;

@Service
public class GoodsServiceImpl implements GoodsService {

	// 依赖注入
	@Autowired
	private GoodsDao goodsDao;
	
	public void setGoodsDao(GoodsDao goodsDao) {
		this.goodsDao = goodsDao;
	}
	
	@Override
	public int countGoods() {
		return goodsDao.countGoods();
	}

	@Override
	public List<Goods> findAll(Map<String, Object> map) {
		return goodsDao.findAll(map);
	}

	@Override
	public int addGoods(Goods u) {
		return goodsDao.addGoods(u);
	}

	@Override
	public int updateGoods(Goods u) {
		return goodsDao.updateGoods(u);
	}

	@Override
	public int deleteGoods(int id) {
		return goodsDao.deleteGoods(id);
	}

	@Override
	public List<Goods> findList() {
		// TODO Auto-generated method stub
		return goodsDao.findList();
	}

}
